package com.five.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 博客文章表
 * </p>
 *
 * @author star
 * @since 2021-06-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Article对象", description="博客文章表")
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "唯一id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "用户id")
    private Long userId;

    @ApiModelProperty(value = "文章类型id")
    private Long articleTypeId;

    @ApiModelProperty(value = "文章标题")
    private String title;

    @ApiModelProperty(value = "文章描述")
    private String articleDescribe;

    @ApiModelProperty(value = "文章内容")
    private String content;

    @ApiModelProperty(value = "点赞数量")
    private Integer praiseNumber;

    @ApiModelProperty(value = "收藏数量")
    private Integer collectionNumber;

    @ApiModelProperty(value = "评论数量")
    private Integer commentNumber;

    @ApiModelProperty(value = "浏览量")
    private Integer browseAmount;

    @ApiModelProperty(value = "是否推荐（1-是 0-否）")
    private Integer recommend;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    //文章类型
    private ArticleType articleType;
    @ApiModelProperty(value = "文章作者昵称")
    private String nickName;

    @ApiModelProperty(value = "文章作者用户名")
    private String username;

    /**
     *  关联标签
     */
    private List<ArticleLabel> articleLabel;

    //文章标签
    private List<Label> labels;


}
